package me.hys.api.doctor;

import java.util.Map;

import me.hys.api.BaseApi;
import me.hys.base.ApiResult;
import me.hys.service.doctor.IPatientManager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.google.common.collect.Maps;

/**
 * Author: @author HYS . <br>
 * Date: 2015-11-30 下午8:37:35 . <br>
 * Function:
 */
@Controller
@RequestMapping("/api/patient")
public class PatientApi extends BaseApi {
	@Autowired
	private IPatientManager patientManager;

	/**
	 * @Title : getCaseImageCount
	 * @Description :
	 */
	@ResponseBody
	@RequestMapping(value = "/getCaseImageCount/{userid}", method = RequestMethod.GET)
	public Map<String, Integer> getCaseImageCount(@PathVariable String userid) {
		Map<String, Integer> result = Maps.newHashMap();
		result.put("result", patientManager.getCaseImageCount(userid));
		return result;
	}

	/**
	 * @Title : saveCaseImageCount
	 * @Description :
	 */
	@ResponseBody
	@RequestMapping(value = "/saveCaseImageCount", method = RequestMethod.POST)
	public ApiResult saveCaseImageCount(@RequestParam String userid,
			@RequestParam int caseImageCount) {
		return patientManager.saveCaseImageCount(userid, caseImageCount);
	}
}
